import sympy as sp

x = sp.Symbol('x')
y = 3 * x ** 2
print(x)
print(y)

# 求导数
y1 = 3 * x
f1 = sp.diff(y1)
print('y1的导数:', f1)

y2 = 3 * x ** 3 + 2 * x ** 2 + 1
y3 = 1 / x
f2 = sp.diff(y2)
f3 = sp.diff(y3)
print('y2的导数:', f2)
print('y3的导数:', f3)

# 求积分
F1 = sp.integrate(f1, x)
print('y1的积分:', F1)

F2 = sp.integrate(f2, x)
print('y2的积分:', F2)
F3 = sp.integrate(f3, x)
print('y3的积分:', F3)

# 求极限
L1 = sp.limit(y1, x, 0)
print(L1)
L2 = sp.limit(y2, x, 0)
print(L2)
L3 = sp.limit(y3, x, 0)
print(L3)
